package com.shg.admin.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.Contact;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

/**
 * @DESCRIPTION: 集成Swagger - Swagger配置
 * @USER: shg
 * @DATE: 2023/5/10 9:46
 */
@Configuration
@EnableSwagger2
public class SwaggerConfig {
    @Bean
    public Docket webApiConfig() {
        return new Docket(DocumentationType.SWAGGER_2)
                .groupName("webApi")
                .apiInfo(webApiInfo())
                .select()
                .build();
    }

    private ApiInfo webApiInfo() {
        return new ApiInfoBuilder()
                .title("服务器密码应用管理系统(外部管理系统)接口文档")
                .description("本文档描述了服务器密码应用管理系统(外部管理系统)的接口定义")
                .version("1.0")
                .contact(new Contact("鼎链数科(深圳有限公司)", "https://www.dinglianshuke.com/", "snl@dinglianshuke.com"))
                .build();
    }
}
